package com.qclix.inv;

import java.util.Calendar;
import java.util.Date;

/**
 * @author Pierre Moermans
 */
public class Holiday {
    private long id;
    private Calendar day;
    private String description;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Calendar getDay() {
        return day;
    }

    public void setDay(Date day) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(day);
        this.day = cal;
    }

    public void setDay(Calendar day) {
        this.day = day;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean isSameDay(Calendar cal) {
        return day.get(Calendar.YEAR) == cal.get(Calendar.YEAR) &&
                day.get(Calendar.MONTH) == cal.get(Calendar.MONTH) &&
                day.get(Calendar.DAY_OF_MONTH) == cal.get(Calendar.DAY_OF_MONTH);
    }

    public boolean isSameDay(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return isSameDay(cal);
    }
}
